package com.gf.demo.debugdemo.service.impl;

import com.gf.demo.debugdemo.model.Banji;
import com.gf.demo.debugdemo.service.BanjiService;
import com.gf.demo.debugdemo.service.precessor.BanjiPreProcessor;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.function.Consumer;

/**
 * @author gaofei
 * @date 2022/8/23 10:37
 */
@Service
public class BanjiServiceImpl implements BanjiService {
    @Resource
    List<BanjiPreProcessor> preProcessor;
    @Override
    public void save(Banji banji) {

    }

    @Override
    public void delete(Banji banji) {
        preProcessor.forEach(new Consumer<BanjiPreProcessor>() {
            @Override
            public void accept(BanjiPreProcessor banjiPreProcessor) {
                banjiPreProcessor.delete();
            }
        });
        // 学校
        // xuexiao  banji xuesheng    xuesheng_banji xuexiao_banji

        // delete from banji where id = **
        // delete from student where banjiid= **
    }
}
